package apigateway.project.core.filter;

import apigateway.project.core.aspect.Order;
import apigateway.project.core.context.GlobalContext;

public interface Filter {

    void doFilter(GlobalContext ctx) throws Exception;

    default int getOrder(){
        Order annotation = this.getClass().getAnnotation(Order.class);
        if(annotation != null){
            return annotation.value();
        }
        //如果没写Order注解就默认排在最后面
        return Integer.MAX_VALUE-1;
    }
}
